package org.yelongframework.qrcode;

import org.yelongframework.commons.nio.charset.CharsetUtil;

/**
 * 二维码属性
 * 
 * @since 1.0.0
 */
public class QRCodeProperties {

	/** 宽度 */
	private final int width;

	/** 高度 */
	private final int height;

	/** 外边距。为0没有内边距。为null为默认外边距 */
	private Integer margin;

	/** 误差等级 */
	private QRCodeErrorCorrectionLevel qrCodeErrorCorrectionLevel;

	/** 编码 */
	private String charset = CharsetUtil.UTF_8_STRING;

	/** 输出的图片格式。如：jpg,png */
	private String imageType = "jpg";

	/**
	 * @param width  宽度
	 * @param height 高度
	 */
	public QRCodeProperties(int width, int height) {
		this.width = width;
		this.height = height;
	}

	public int getWidth() {
		return width;
	}

	public int getHeight() {
		return height;
	}

	public QRCodeErrorCorrectionLevel getQrCodeErrorCorrectionLevel() {
		return qrCodeErrorCorrectionLevel;
	}

	public QRCodeProperties setQrCodeErrorCorrectionLevel(QRCodeErrorCorrectionLevel qrCodeErrorCorrectionLevel) {
		this.qrCodeErrorCorrectionLevel = qrCodeErrorCorrectionLevel;
		return this;
	}

	public String getImageType() {
		return imageType;
	}

	public QRCodeProperties setImageType(String imageType) {
		this.imageType = imageType;
		return this;
	}

	public Integer getMargin() {
		return margin;
	}

	public QRCodeProperties setMargin(Integer margin) {
		this.margin = margin;
		return this;
	}

	public String getCharset() {
		return charset;
	}

	public QRCodeProperties setCharset(String charset) {
		this.charset = charset;
		return this;
	}

}
